import http from '../http'

//列表数据
export const informationApi = () => http({
    url: "/goods/select",
    method: "POST",
});

//删除
export const delList = (id) => http({
    url: "/goods/deleteGoods",
    method: "POST",
    params: {
        id
    }
})
//商品分页
export const pageInformation = (params) => http({
    url: "/goods/selectGoodsByPage",
    method: "POST",
    params
})

//编辑
export const editApi = (data) => {
    // console.log('编辑的数据', data)
   return http({
        url: "/goods/update",
        method: "POST",
        data
    })
}

//添加
export const addGoods = (obj) => {
    // console.log(obj);

    return http({
        url: "/goods/addGoods",
        method: "POST",
        data: obj
    })
}

//排序
export const sortApi = (sort) => http({
    url: "/goods/changeSort",
    method: "POST",
    params: {
        sort
    }
})

//下拉框 商品类型和商品品牌以及厂商
export const selsetTwoApi = () => http({
    url: "/goods/selectTwo",
    method: "POST",
})

export const selectApi = () => http({
    url: "/measure/selectAll",
    method: "POST"
})

//低级检索
export const lowApi = (params) => {
    // console.log(params)
    return http({
        url: "/goods/selectGoodsLow",
        method: "POST",
        params
    })
}

//高级检索
export const seniorApi = (params) => http({
    url: "/goods/selectGoodsHigh",
    method: "POST",
    params
})

//修改上下架状态
export const isUsedApi = (data) => http({
    url: "/goods/updateState",
    method: "POST",
    data
})

//导入
export const leadApi = (data) => http({
    url: "/goods/lead",
    method: "POST",
    data
})

//导出
export const outputApi = () => http({
    url: "/goods/exportAll",
    method: "POST",
    responseType: "arraybuffer"
})
